﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ZK.Common;
using ZK.Models;

namespace ZK.InterfaceServer
{
    public partial class AutoControlTransportApiServer
    {

        private static readonly string AutoControlTransportCN = "autoControlTransport/";

        private static readonly string GetTheLatestAN = AutoControlTransportCN + "getTheLatest";//获取最后磅单信息接口
        private static readonly string GetTruckYxInfoAN = AutoControlTransportCN + "getTruckYxInfo";//获取当前车辆信息接口
        private static readonly string TruckExitAN = AutoControlTransportCN + "truckExit";//车辆出矿接口  
        private static readonly string TruckTareAN = AutoControlTransportCN + "truckTare";//车辆除皮接口
        private static readonly string TruckUnloadingAN = AutoControlTransportCN + "truckUnloading";//车辆卸车接口
        private static readonly string TruckWeighAN = AutoControlTransportCN + "truckWeigh";//车辆称重接口
        private static readonly string EndYxInfoAN = AutoControlTransportCN + "endYxInfo";//结束运销流程
        private static readonly string GetSendTypeByCardNoAN = AutoControlTransportCN + "getSendTypeByCardNo";//通过卡号判断采购销售
        private static readonly string AutoIntoExitAN = AutoControlTransportCN + "autoIntoExit";//自动出入厂
        private static readonly string GetHardWareSAN = AutoControlTransportCN + "getHardWareS";//设备监控列表查询
        private static readonly string AddHardWareAN = AutoControlTransportCN + "addHardWare";//设备监控新增接口
        private static readonly string UpdateHardWareByidAN = AutoControlTransportCN + "updateHardWareByid";//设备监控列修改接口
        private static readonly string GetHardWareByIdAN = AutoControlTransportCN + "getHardWareById";//设备监控详情
        private static readonly string DelHardWareByIdAN = AutoControlTransportCN + "delHardWareById";//设备删除接口
        private static readonly string GetBlackAN = AutoControlTransportCN + "getBlack";//当前车辆是否为黑名单
        private static readonly string UpdateHardWareByNameAN = AutoControlTransportCN + "updateHardWareByName";//根据硬件名称修改硬件状态
        private static readonly string AddHardWareLogAN = AutoControlTransportCN + "addHardWareLog";//添加硬件异常信息
        private static readonly string PlatformHeavyWeightAN = AutoControlTransportCN + "platformHeavyWeight";//站台过重磅
        private static readonly string PlatformLightWeightAN = AutoControlTransportCN + "platformLightWeight";//站台过轻磅
        private static readonly string TruckLoadingAN = AutoControlTransportCN + "truckLoading";//车辆装车接口
        private static readonly string AddWeightBillAN = AutoControlTransportCN + "addWeightBill";//生成榜单(杨货盘内)
        private static readonly string PrintWeightBillAN = AutoControlTransportCN + "printWeightBill";//磅单打印接口
        private static readonly string GetWeightBillsAN = AutoControlTransportCN + "getWeightBills";//已生成磅单列表
        private static readonly string AddInnerWeightBillAN = AutoControlTransportCN + "addInnerWeightBill";//已生成磅单列表
        private static readonly string TruckIntoCoalmineAN = AutoControlTransportCN + "truckIntoCoalmine";//车辆入场接口


        private static readonly string WeighbridgeCN = "weighbridge/";
        private static readonly string ListWeighbridgeAN = WeighbridgeCN + "listWeighbridge";//地磅信息列表




        /// <summary>
        /// 车辆入场接口 post
        /// </summary>
        /// <param name="m"></param>
        /// <returns></returns>
        public static Models.ReceiveDataBase<object> TruckIntoCoalmine(TruckIntoCoalmineSendM m)
        {
            string url = InterfaceExecute.GetUrl(TruckIntoCoalmineAN);
            string ret;
            try
            {
                ret = HttpClientUtil.doPostMethodToString(url, Newtonsoft.Json.JsonConvert.SerializeObject(m));
            }
            catch (Exception ex)
            {
                Common.Log4.LogManage.WriteErr("TruckIntoCoalmine " + ex.ToString());
                return null;
            }
            return Newtonsoft.Json.JsonConvert.DeserializeObject<ReceiveDataBase<object>>(ret);

        }

        /// <summary>
        /// 境内票系统接口 添加打印数据
        /// </summary>
        /// <param name="truckNo"></param>
        /// <returns></returns>
        public static Models.ReceiveDataBase<object> AddInnerWeightBill(string wbid)
        {
            Dictionary<string, string> keyValuePairs = new Dictionary<string, string>();
            keyValuePairs.Add("wbid", wbid);
            string url = InterfaceExecute.GetUrl(AddInnerWeightBillAN, keyValuePairs);
            string ret;
            try
            {
                ret = HttpClientUtil.doGetMethodToString(url);
            }
            catch (Exception ex)
            {
                Common.Log4.LogManage.WriteErr("AddInnerWeightBill " + ex.ToString());
                return null;
            }
            return Newtonsoft.Json.JsonConvert.DeserializeObject<Models.ReceiveDataBase<object>>(ret);

        }
        /// <summary>
        /// 生成榜单(杨货盘内) post
        /// </summary>
        /// <param name="m"></param>
        /// <returns></returns>
        public static GetWeightBillsRceiveM GetWeightBills(GetWeightBillsSendM m)
        {
            string url = InterfaceExecute.GetUrl(GetWeightBillsAN);
            string ret;
            try
            {
                ret = HttpClientUtil.doPostMethodToString(url, Newtonsoft.Json.JsonConvert.SerializeObject(m));
            }
            catch (Exception ex)
            {
                Common.Log4.LogManage.WriteErr("TruckLoading " + ex.ToString());
                return null;
            }
            return Newtonsoft.Json.JsonConvert.DeserializeObject<GetWeightBillsRceiveM>(ret);

        }

        /// <summary>
        /// 磅单打印接口 post
        /// </summary>
        /// <param name="wbid"></param>
        /// <returns></returns>
        public static ReceiveDataBase<int?> PrintWeightBill(string wbid)
        {
            Dictionary<string, string> keyValuePairs = new Dictionary<string, string>();
            keyValuePairs.Add("wbid", wbid);
            string url = InterfaceExecute.GetUrl(PrintWeightBillAN, keyValuePairs);
            string ret;
            try
            {
                ret = HttpClientUtil.doPostMethodToString(url);
            }
            catch (Exception ex)
            {
                Common.Log4.LogManage.WriteErr("TruckLoading " + ex.ToString());
                return null;
            }
            return Newtonsoft.Json.JsonConvert.DeserializeObject<ReceiveDataBase<int?>>(ret);

        }

        /// <summary>
        /// 生成榜单(杨货盘内) post
        /// </summary>
        /// <param name="m"></param>
        /// <returns></returns>
        public static ReceiveDataBase<int?> AddWeightBill(AddWeightBillSendM m)
        {
            string url = InterfaceExecute.GetUrl(AddWeightBillAN);
            string ret;
            try
            {
                ret = HttpClientUtil.doPostMethodToString(url, Newtonsoft.Json.JsonConvert.SerializeObject(m));
            }
            catch (Exception ex)
            {
                Common.Log4.LogManage.WriteErr("AddWeightBill " + ex.ToString());
                return null;
            }
            return Newtonsoft.Json.JsonConvert.DeserializeObject<ReceiveDataBase<int?>>(ret);

        }
        /// <summary>
        /// 车辆装车接口 post
        /// </summary>
        /// <param name="m"></param>
        /// <returns></returns>
        public static ReceiveDataBase<int?> TruckLoading(TruckLoadingSendM m)
        {
            string url = InterfaceExecute.GetUrl(TruckLoadingAN);
            string ret;
            try
            {
                ret = HttpClientUtil.doPostMethodToString(url, Newtonsoft.Json.JsonConvert.SerializeObject(m));
            }
            catch (Exception ex)
            {
                Common.Log4.LogManage.WriteErr("TruckLoading " + ex.ToString());
                return null;
            }
            return Newtonsoft.Json.JsonConvert.DeserializeObject<ReceiveDataBase<int?>>(ret);

        }
        /// <summary>
        /// 站台过轻磅 post
        /// </summary>
        /// <param name="m"></param>
        /// <returns></returns>
        public static ReceiveDataBase<int?> PlatformLightWeight(PlatformLightWeightSendM m)
        {
            string url = InterfaceExecute.GetUrl(PlatformLightWeightAN);
            string ret;
            try
            {
                ret = HttpClientUtil.doPostMethodToString(url, Newtonsoft.Json.JsonConvert.SerializeObject(m));
            }
            catch (Exception ex)
            {
                Common.Log4.LogManage.WriteErr("PlatformHeavyWeight " + ex.ToString());
                return null;
            }
            return Newtonsoft.Json.JsonConvert.DeserializeObject<ReceiveDataBase<int?>>(ret);

        }
        /// <summary>
        /// 站台过重磅 post
        /// </summary>
        /// <param name="m"></param>
        /// <returns></returns>
        public static ReceiveDataBase<int?> PlatformHeavyWeight(PlatformHeavyWeightSendM m)
        {
            string url = InterfaceExecute.GetUrl(PlatformHeavyWeightAN);
            string ret;
            try
            {
                ret = HttpClientUtil.doPostMethodToString(url, Newtonsoft.Json.JsonConvert.SerializeObject(m));
            }
            catch (Exception ex)
            {
                Common.Log4.LogManage.WriteErr("PlatformHeavyWeight " + ex.ToString());
                return null;
            }
            return Newtonsoft.Json.JsonConvert.DeserializeObject<ReceiveDataBase<int?>>(ret);

        }
        /// <summary>
        /// 获取最后磅单信息接口
        /// </summary>
        /// <param name="cardNo"></param>
        /// <returns></returns>
        //public static ReceiveDataBase<YxYsTransportReturnDto> GetTheLatest(string cardNo)
        //{
        //    Dictionary<string, string> keyValuePairs = new Dictionary<string, string>();
        //    keyValuePairs.Add("cardNo", cardNo);
        //    string url = InterfaceExecute.GetUrl(GetTheLatestAN, keyValuePairs);
        //    string ret;
        //    try
        //    {
        //        ret = HttpClientUtil.doGetMethodToString(url);
        //    }
        //    catch (Exception ex)
        //    {
        //        Common.Log4.LogManage.WriteErr("GetTheLatest " + ex.ToString());
        //        return null;
        //    }
        //    return Newtonsoft.Json.JsonConvert.DeserializeObject<ReceiveDataBase<YxYsTransportReturnDto>>(ret);

        //}

        /// <summary>
        /// 结束运销流程
        /// </summary>
        /// <param name="cardNo"></param>
        /// <returns></returns>
        //public static ReceiveDataBase<int?> EndYxInfo(string cardNo)
        //{
        //    Dictionary<string, string> keyValuePairs = new Dictionary<string, string>();
        //    keyValuePairs.Add("cardNo", cardNo);
        //    string url = InterfaceExecute.GetUrl(EndYxInfoAN, keyValuePairs);
        //    string ret;
        //    try
        //    {
        //        ret = HttpClientUtil.doGetMethodToString(url);
        //    }
        //    catch (Exception ex)
        //    {
        //        Common.Log4.LogManage.WriteErr("EndYxInfo " + ex.ToString());
        //        return null;
        //    }
        //    return Newtonsoft.Json.JsonConvert.DeserializeObject<ReceiveDataBase<int?>>(ret);

        //}
        /// <summary>
        /// 添加硬件异常信息
        /// </summary>
        /// <param name="wareName"></param>
        /// <param name="wareState"></param>
        /// <param name="remark"></param>
        public static void AddHardWareLog(string wareName, int wareState, string remark)
        {
            if (Common.AppConfigHelper.GetAppSettings("HardWareLog") == "true")
            {
                var m = new { wareName = wareName, wareState = wareState, remark = remark };
                string ret;
                string url = InterfaceExecute.GetUrl(AddHardWareLogAN);
                try
                {
                    ret = HttpClientUtil.doPostMethodToString(url, Newtonsoft.Json.JsonConvert.SerializeObject(m));
                }
                catch (Exception ex)
                {
                    Common.Log4.LogManage.WriteErr("AddHardWareLog " + ex.Message);
                }
            }
        }

        /// <summary>
        /// 根据硬件名称修改硬件状态
        /// </summary>
        /// <param name="wareName"></param>
        /// <param name="wareState"></param>
        /// <param name="remark"></param>
        /// <returns></returns>
        //public static void UpdateHardWareByName(string wareName, int wareState, string remark)
        //{
        //    string ret;
        //    Dictionary<string, string> keyValuePairs = new Dictionary<string, string>();
        //    keyValuePairs.Add("wareName", wareName);
        //    keyValuePairs.Add("wareState", wareState.ToString());
        //    keyValuePairs.Add("remark", remark);
        //    string url = InterfaceExecute.GetUrl(UpdateHardWareByNameAN, keyValuePairs);
        //    try
        //    {
        //        ret = HttpClientUtil.doPostMethodToString(url);
        //    }
        //    catch (Exception ex)
        //    {
        //        Common.Log4.LogManage.WriteErr(ex.Message);
        //    }

        //}


        /// <summary>
        /// 根据硬件名称修改硬件状态
        /// </summary>
        /// <param name="wareName"></param>
        /// <param name="wareState"></param>
        /// <param name="remark"></param>
        /// <returns></returns>
        public static Models.ReceiveDataBase<int?> UpdateHardWareByName(string wareName, int wareState, string remark)
        {
            string ret;
            Dictionary<string, string> keyValuePairs = new Dictionary<string, string>();
            keyValuePairs.Add("wareName", wareName);
            keyValuePairs.Add("wareState", wareState.ToString());
            keyValuePairs.Add("remark", remark);
            string url = InterfaceExecute.GetUrl(UpdateHardWareByNameAN, keyValuePairs);
            try
            {
                ret = HttpClientUtil.doPostMethodToString(url);
            }
            catch (Exception ex)
            {
                Common.Log4.LogManage.WriteErr("UpdateHardWareByName " + ex.ToString());
                return null;
            }
            return Newtonsoft.Json.JsonConvert.DeserializeObject<Models.ReceiveDataBase<int?>>(ret);

        }


        /// <summary>
        /// 当前车辆是否为黑名单
        /// </summary>
        /// <param name="truckNo"></param>
        /// <returns></returns>
        public static Models.ReceiveDataBase<bool> GetBlack(string truckNo)
        {
            Dictionary<string, string> keyValuePairs = new Dictionary<string, string>();
            keyValuePairs.Add("truckNo", truckNo);
            string url = InterfaceExecute.GetUrl(GetBlackAN, keyValuePairs);
            string ret;
            try
            {
                ret = HttpClientUtil.doGetMethodToString(url);
            }
            catch (Exception ex)
            {
                Common.Log4.LogManage.WriteErr("GetBlack " + ex.ToString());
                return null;
            }
            return Newtonsoft.Json.JsonConvert.DeserializeObject<Models.ReceiveDataBase<bool>>(ret);

        }
        /// <summary>
        /// 设备删除接口
        /// </summary>
        /// <param name="hid"></param>
        /// <returns></returns>
        public static Models.ReceiveDataBase<string> DelHardWareById(string hid)
        {
            string url = InterfaceExecute.GetUrl(DelHardWareByIdAN);
            string ret;
            try
            {
                ret = HttpClientUtil.doPostMethodToString(url, hid);
            }
            catch (Exception ex)
            {
                Common.Log4.LogManage.WriteErr("DelHardWareById " + ex.ToString());
                return null;
            }
            return Newtonsoft.Json.JsonConvert.DeserializeObject<Models.ReceiveDataBase<string>>(ret);

        }
        /// <summary>
        /// 设备监控列表查询
        /// </summary>
        /// <param name="getHardWareSSendM"></param>
        /// <returns></returns>
        public static GetHardWareSRceiveM GetHardWareS(GetHardWareSSendM getHardWareSSendM)
        {
            Dictionary<string, string> data = new Dictionary<string, string>();
            string url = InterfaceExecute.GetUrl(GetHardWareSAN);
            string ret;
            try
            {
                ret = HttpClientUtil.doPostMethodToString(url, Newtonsoft.Json.JsonConvert.SerializeObject(getHardWareSSendM));
            }
            catch (Exception ex)
            {
                Common.Log4.LogManage.WriteErr("GetHardWareS " + ex.ToString());
                return null;
            }
            return Newtonsoft.Json.JsonConvert.DeserializeObject<GetHardWareSRceiveM>(ret);

        }
        /// <summary>
        /// 设备监控新增接口
        /// </summary>
        /// <param name="hardWareM"></param>
        /// <returns></returns>
        public static Models.ReceiveDataBase<string> AddHardWare(HardWareM hardWareM)
        {
            string url = InterfaceExecute.GetUrl(AddHardWareAN);
            string ret;
            try
            {
                ret = HttpClientUtil.doPostMethodToString(url, Newtonsoft.Json.JsonConvert.SerializeObject(hardWareM));
            }
            catch (Exception ex)
            {
                Common.Log4.LogManage.WriteErr("AddHardWare " + ex.ToString());
                return null;
            }
            return Newtonsoft.Json.JsonConvert.DeserializeObject<Models.ReceiveDataBase<string>>(ret);
        }
        /// <summary>
        /// 设备监控列更新接口
        /// </summary>
        /// <param name="hardWareM"></param>
        /// <returns></returns>
        public static Models.ReceiveDataBase<string> UpdateHardWareByid(HardWareM hardWareM)
        {
            string url = InterfaceExecute.GetUrl(UpdateHardWareByidAN);
            string ret;
            try
            {
                ret = HttpClientUtil.doPostMethodToString(url, Newtonsoft.Json.JsonConvert.SerializeObject(hardWareM));
            }
            catch (Exception ex)
            {
                Common.Log4.LogManage.WriteErr("UpdateHardWareByid " + ex.ToString());
                return null;
            }
            return Newtonsoft.Json.JsonConvert.DeserializeObject<Models.ReceiveDataBase<string>>(ret);

        }
        /// <summary>
        /// 设备监控详情
        /// </summary>
        /// <param name="hid"></param>
        /// <returns></returns>
        public static Models.ReceiveDataBase<HardWareM> GetHardWareById(string hid)
        {
            Dictionary<string, string> keyValuePairs = new Dictionary<string, string>();
            keyValuePairs.Add("hid", hid);
            string url = InterfaceExecute.GetUrl(GetHardWareByIdAN, keyValuePairs);
            string ret;
            try
            {
                ret = HttpClientUtil.doGetMethodToString(url);
            }
            catch (Exception ex)
            {
                Common.Log4.LogManage.WriteErr("GetHardWareById" + ex.ToString());
                return null;
            }
            return Newtonsoft.Json.JsonConvert.DeserializeObject<Models.ReceiveDataBase<HardWareM>>(ret);

        }


        /// <summary>
        /// 自动出入厂
        /// </summary>
        /// <param name="wareName"></param>
        /// <param name="wareState"></param>
        /// <param name="remark"></param>
        /// <returns></returns>
        public static Models.ReceiveDataBase<int?> AutoIntoExit(AutoIntoExitSendM autoIntoExitSendM)
        {
            string ret;
            string url = InterfaceExecute.GetUrl(AutoIntoExitAN);
            try
            {
                ret = HttpClientUtil.doPostMethodToString(url, Newtonsoft.Json.JsonConvert.SerializeObject(autoIntoExitSendM));
            }
            catch (Exception ex)
            {
                Common.Log4.LogManage.WriteErr("AutoIntoExit " + ex.ToString());
                return null;
            }
            return Newtonsoft.Json.JsonConvert.DeserializeObject<Models.ReceiveDataBase<int?>>(ret);

        }


        /// <summary>
        /// 地磅信息列表
        /// </summary>
        /// <param name="listWeighbridgeSendM"></param>
        /// <returns></returns>
        public static Models.ReceiveDataBase<List<ListWeighbridgeReceiveM>> ListWeighbridge(ListWeighbridgeSendM listWeighbridgeSendM)
        {
            string url = InterfaceExecute.GetUrl(ListWeighbridgeAN);
            string ret;
            try
            {
                ret = HttpClientUtil.doPostMethodToString(url, Newtonsoft.Json.JsonConvert.SerializeObject(listWeighbridgeSendM));
            }
            catch (Exception ex)
            {
                Common.Log4.LogManage.WriteErr("ListWeighbridge " + ex.ToString());
                return null;
            }
            return Newtonsoft.Json.JsonConvert.DeserializeObject<Models.ReceiveDataBase<List<ListWeighbridgeReceiveM>>>(ret);

        }
        /// <summary>
        /// 通过卡号判断采购销售
        /// </summary>
        /// <param name="cardNo"></param>
        /// <returns></returns>
        public static Models.ReceiveDataBase<int?> GetSendTypeByCardNo(string cardNo)
        {
            Dictionary<string, string> keyValuePairs = new Dictionary<string, string>();
            keyValuePairs.Add("cardNo", cardNo);
            string url = InterfaceExecute.GetUrl(GetSendTypeByCardNoAN, keyValuePairs);
            string ret;
            try
            {
                ret = HttpClientUtil.doGetMethodToString(url);
            }
            catch (Exception ex)
            {
                Common.Log4.LogManage.WriteErr("GetSendTypeByCardNo " + ex.ToString());
                return null;
            }
            return Newtonsoft.Json.JsonConvert.DeserializeObject<Models.ReceiveDataBase<int?>>(ret);

        }
        /// <summary>
        /// 结束运销流程
        /// </summary>
        /// <param name="cardNo"></param>
        /// <returns></returns>
        public static Models.ReceiveDataBase<int?> EndYxInfo(string cardNo)
        {
            Dictionary<string, string> keyValuePairs = new Dictionary<string, string>();
            keyValuePairs.Add("cardNo", cardNo);
            string url = InterfaceExecute.GetUrl(EndYxInfoAN, keyValuePairs);
            string ret;
            try
            {
                ret = HttpClientUtil.doGetMethodToString(url);
            }
            catch (Exception ex)
            {
                Common.Log4.LogManage.WriteErr("EndYxInfo " + ex.ToString());
                return null;
            }
            return Newtonsoft.Json.JsonConvert.DeserializeObject<Models.ReceiveDataBase<int?>>(ret);

        }
        /// <summary>
        /// 车辆称重接口
        /// </summary>
        /// <param name="weightDtoSendM"></param>
        /// <returns></returns>
        public static Models.ReceiveDataBase<int?> TruckWeigh(WeightDtoSendM weightDtoSendM)
        {
            string url = InterfaceExecute.GetUrl(TruckWeighAN);
            string ret;
            try
            {
                ret = HttpClientUtil.doPostMethodToString(url, Newtonsoft.Json.JsonConvert.SerializeObject(weightDtoSendM));
            }
            catch (Exception ex)
            {
                Common.Log4.LogManage.WriteErr("TruckWeigh " + ex.ToString());
                return null;
            }
            return Newtonsoft.Json.JsonConvert.DeserializeObject<Models.ReceiveDataBase<int?>>(ret);

        }
        /// <summary>
        /// 车辆卸车接口
        /// </summary>
        /// <param name="unloadingDtoSendM"></param>
        /// <returns></returns>
        public static Models.ReceiveDataBase<int?> TruckUnloading(UnloadingDtoSendM unloadingDtoSendM)
        {
            string url = InterfaceExecute.GetUrl(TruckUnloadingAN);
            string ret;
            try
            {
                ret = HttpClientUtil.doPostMethodToString(url, Newtonsoft.Json.JsonConvert.SerializeObject(unloadingDtoSendM));
            }
            catch (Exception ex)
            {
                Common.Log4.LogManage.WriteErr("TruckUnloading " + ex.ToString());
                return null;
            }
            return Newtonsoft.Json.JsonConvert.DeserializeObject<Models.ReceiveDataBase<int?>>(ret);

        }
        /// <summary>
        /// 车辆除皮接口
        /// </summary>
        /// <param name="tareDtoSendM"></param>
        /// <returns></returns>
        public static Models.ReceiveDataBase<int?> TruckTare(TareDtoSendM tareDtoSendM)
        {
            string url = InterfaceExecute.GetUrl(TruckTareAN);
            string ret;
            try
            {
                ret = HttpClientUtil.doPostMethodToString(url, Newtonsoft.Json.JsonConvert.SerializeObject(tareDtoSendM));
            }
            catch (Exception ex)
            {
                Common.Log4.LogManage.WriteErr("TruckTare " + ex.ToString());
                return null;
            }
            return Newtonsoft.Json.JsonConvert.DeserializeObject<Models.ReceiveDataBase<int?>>(ret);

        }
        /// <summary>
        /// 车辆出矿接口
        /// </summary>
        /// <param name="exitDtoSendM"></param>
        /// <returns></returns>
        public static Models.ReceiveDataBase<int?> TruckExit(ExitDtoSendM exitDtoSendM)
        {
            string url = InterfaceExecute.GetUrl(TruckExitAN);
            string ret;
            try
            {
                ret = HttpClientUtil.doPostMethodToString(url, Newtonsoft.Json.JsonConvert.SerializeObject(exitDtoSendM));
            }
            catch (Exception ex)
            {
                Common.Log4.LogManage.WriteErr("TruckExit " + ex.ToString());
                return null;
            }
            return Newtonsoft.Json.JsonConvert.DeserializeObject<Models.ReceiveDataBase<int?>>(ret);

        }
        /// <summary>
        /// 获取当前车辆信息接口
        /// </summary>
        /// <param name="cardNo"></param>
        /// <returns></returns>
        public static Models.ReceiveDataBase<Models.GetTruckYxInfoRceiveM> GetTruckYxInfo(Models.GetTruckYxInfoSendM model)
        {
            string url = InterfaceExecute.GetUrl(GetTruckYxInfoAN);
            string ret;
            string modelStr = Newtonsoft.Json.JsonConvert.SerializeObject(model);
            try
            {
                ret = HttpClientUtil.doPostMethodToString(url, modelStr);
            }
            catch (Exception ex)
            {
                Common.Log4.LogManage.WriteErr("GetTruckYxInfo " + ex.ToString());
                return new Models.ReceiveDataBase<Models.GetTruckYxInfoRceiveM>() { success=false,msg="接口调用失败，可能服务宕机!",data=new GetTruckYxInfoRceiveM()};
            }
            var resM = Newtonsoft.Json.JsonConvert.DeserializeObject<Models.ReceiveDataBase<Models.GetTruckYxInfoRceiveM>>(ret);
            if (resM.data == null)
            {
                resM.data = new GetTruckYxInfoRceiveM();
            }
            return resM;
        }
        /// <summary>
        /// 获取最后磅单信息接口
        /// </summary>
        /// <param name="cardNo"></param>
        /// <returns></returns>
        public static Models.ReceiveDataBase<Models.GetTruckYxInfoRceiveM> GetTheLatest(string cardNo)
        {
            Dictionary<string, string> keyValuePairs = new Dictionary<string, string>();
            keyValuePairs.Add("cardNo", cardNo);
            string url = InterfaceExecute.GetUrl(GetTheLatestAN, keyValuePairs);
            string ret;
            try
            {
                ret = HttpClientUtil.doGetMethodToString(url);
            }
            catch (Exception ex)
            {
                Common.Log4.LogManage.WriteErr("GetTheLatest " + ex.ToString());
                return null;
            }
            return Newtonsoft.Json.JsonConvert.DeserializeObject<Models.ReceiveDataBase<Models.GetTruckYxInfoRceiveM>>(ret);

        }


    }
}
